package net.starwifi.duobao.web;

import net.starwifi.duobao.mvc.Message;
import net.starwifi.duobao.rmi.AppRMIUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by ruoo on 15/12/27.
 */
@Controller("adminStaticController")
@RequestMapping("/static")
public class StaticController extends BaseController {



    /**
     * 生成静态(view)
     */
    @RequestMapping(value = "/edit", method = RequestMethod.GET)
    public String edit(ModelMap model) {
        return "/static/edit";
    }



    /**
     * 生成静态(build)
     */
    @ResponseBody
    @RequestMapping(value = "/build", method = RequestMethod.POST)
    public Object build(ModelMap model,String key,String content) {
        String result=AppRMIUtils.rmiApi(key,content);
        return Message.success(result);
    }



}
